﻿/**
 * ...
 * @author George Mavchun
 */

package gui.hug.priv;

import flash.display.Shape;
import flash.display.Sprite;
import flash.display.Loader;
import flash.net.URLRequest;
import gui.hug.HUGLabel;
import gui.hug.HUGColors;
import gui.hug.HUGSprite;

class HUGNumericStepperButtonDisplayState extends HUGSprite
{
	private static inline var LEFT_IMAGE_URL : String = "http://cs9712.vkontakte.ru/u04866/95177834/x_610fd962.jpg";
	private static inline var RIGHT_IMAGE_URL : String = "http://cs9712.vkontakte.ru/u04866/95177834/x_6de3c378.jpg";

	public function new(left : Bool, bgColor : Int) 
	{
		super();
		addImage(left, bgColor);
	}

	private function addImage(left : Bool, bgColor : Int) {
		this.graphics.lineStyle(1, HUGColors.VK_BORDER_OUTER);
		this.graphics.beginFill(HUGColors.WHITE);
        this.graphics.drawRect(0, 0, 20, 20);
        this.graphics.endFill();
		
		this.graphics.lineStyle(1, HUGColors.WHITE);
		this.graphics.beginFill(bgColor);
		this.graphics.drawRect(1, 1, 18, 18);
		this.graphics.endFill();
		
		var icon: Loader = new Loader();
		icon.load(new URLRequest(left ? LEFT_IMAGE_URL : RIGHT_IMAGE_URL));
		icon.x = 5;
		icon.y = 4;
		this.addChild(icon);
	}
	
}